package com.jiyun.h2303b.controller;

import cn.hutool.core.util.IdUtil;
import com.jiyun.h2303b.pojo.AlipayBean;
import com.jiyun.h2303b.utils.AlipayUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("ali")
@RestController
public class AliPayController {



    @RequestMapping("pay")
    public String pay(@RequestBody AlipayBean alipayBean) throws Exception{
        alipayBean.setOut_trade_no(IdUtil.getSnowflakeNextIdStr());
       return AlipayUtils.pay(alipayBean);
    }
}
